import './roles.html';

import '../components/data_table/data_table.js';

import { Roles } from '/imports/api/roles/roles.js';



Template.Admin_Roles.onCreated(function () {
		let self = this;

		

		self.loadready = new ReactiveVar();

		Meteor.subscribe('roles.limit', parseInt(FlowRouter.getParam("page"))-1, 3);

	

});


Template.Admin_Roles.helpers({
	
	modelname(){
		return '角色';
	},
	tableheads(){
		return ['名称', '权重', '创建日期'];
	},
	subsReady(){
		return 'onepage.roles';
	},
	modelmethods(){
		return {
			delete: "roles.delete",
			create: "roles.insert",
			update: "roles.update"
		}
	},
	render(modelname, tableheads, subsReady, modelmethods) {
		return {
			modelname,
			tableheads,
			subsReady,
			model: Roles,
			modelmethods
		};
	},

	renderCreateModal(title, createForm){
		return {
			title
		}
	},

	title(){
		return '新建角色';
	},

	createForm(){
		return 'new_role_form';
	}

})